
#include "sdl_lcd/LCD_def.h"
#include "sdl_lcd/ScreenPort.h"
#include "sdl_lcd/Key.h"
#include "mayUI/mayui.h"
#include "widget/widget.h"
#include "widget/bar.h"
#include "widget/label.h"
#include "widget/tail.h"

int main(int argc,char* argv[])//完整的mian函数定义
{
    SDL_Init(SDL_INIT_VIDEO);//初始化SDL库
    lcd_beginSDL();
    lcd_CreatWindow_surface_texture();

    ScreenPortInit();

    mayui_init(160,64);

    may_screen_t* scr = screen_create(128,64);
    may_tail_view_t* tail = tail_view_create(scr);
    may_lable_t* lb1 = label_create(NULL, 0,0,"lb1");
    may_lable_t* lb2 = label_create(NULL, 0,16,"lb2");
    may_lable_t* lb3 = label_create(NULL, 0,32,"lb3");

    tail_view_add_widget(tail, lb1);
    tail_view_add_widget(tail, lb2);
    tail_view_add_widget(tail, lb3);

    while(quit)
    {
        Key_HandleEvent();
        ScreenPort.SyncToScreen();

    }


    lcd_Destroy();//退出SDL

    return 0;
}
